A solver for system(s) of linear equations in parallel. More...
#include <linear_solver.hpp>
Public Types | |
typedef BaseLinearSolverInterface< T, I >::MatrixType | MatrixType |
typedef BaseLinearSolverInterface< T, I >::VectorType | VectorType |
Public Member Functions | |
LinearSolverT (MatrixType &A) | |
Default constructor. | |
~LinearSolverT (void) | |
Destructor. |
A solver for system(s) of linear equations in parallel.
A LinearSolver is used to solve a system of linear equations:
where is the coefficient matrix, and
and
are vectors.
A LinearSolver is instantiated using an existing coefficient Matrix. It must be intantiated simutaneously on all processes involved in the communicator used by the coefficent Matrix. It similarly must be destroyed simultaneously on all processes.
A particular system is solved using the solve() method, which requires the Vector and a Vector that serves as the intial estimate of
. Multiple systems can be solved using the same coefficient matrix by repeatedly calling solve() with different
and
vectors. If the coefficient matrix changes in any way (even just the coefficients) between system solutions, the setMatrix() method must be called before solve();
This class encapuslates the linear system solver of the underlying math library. The Pimpl idiom is used for implementation, so user code is completely independent of the underlying library. This class simply provides an interface to a specific implementation.
typedef BaseLinearSolverInterface<T, I>::MatrixType gridpack::math::LinearSolverT< T, I >::MatrixType |
Reimplemented from gridpack::math::BaseLinearSolverInterface< T, I >.
typedef BaseLinearSolverInterface<T, I>::VectorType gridpack::math::LinearSolverT< T, I >::VectorType |
Reimplemented from gridpack::math::BaseLinearSolverInterface< T, I >.
gridpack::math::LinearSolverT< T, I >::LinearSolverT | ( | MatrixType & | A | ) |
Default constructor.
Collective
This will create a LinearSolver instance on the same communicator used by the coefficient Matrix A
. All processes in the communicator must call this simultaneously.
The Matrix A
must exist for the life of this instance.
A | existing, filled coefficient matrix |
gridpack::math::LinearSolverT< T, I >::~LinearSolverT | ( | void | ) |
Destructor.
Collective
This destroys a LinearSolver. It must be called simutaneously by all processes involved in calling the constructor.